import { createRouter, createWebHashHistory } from 'vue-router'

import Device from '@/views/Device.vue'
import Product from '@/views/Product.vue'
import Login from '@/components/router-page/Login.vue'
import IoT from '@/components/router-page/IoT.vue'
import Register from '@/components/router-page/Register.vue'
import third from '@/components/router-page/third.vue'
import Prompt from '@/components/router-page/Prompt.vue'
import DeviceChild from '@/views/DeviceChild.vue';

const routes = [
  {
    path: '/',
    component: Login
  },
  {
    path: '/register',
    component: Register
  },
  {
    path: '/prompt',
    component: Prompt
  },
  
  {
    path: '/IoT',
    component: IoT,
    children: [
      {
        path: '',
        component: third
      },
      {
        path: 'device',
        component: Device,

      },
      {
        path: 'product',
        component: Product
      },
      {
        path: 'deviceChild/:id',
        component: DeviceChild
      }
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
